/*
 *    seg7.h  -  header file of seg7
 *
 *	  Board:		akae2440
 *    environment:	u-boot & ADS
 *    Author:		akaedu
 *    Date:			2009-5-26
 *    web:			www.akaedu.org
 *
 */


#define	SEG_A		(0x1<<0)
#define	SEG_B		(0x1<<1)
#define	SEG_C		(0x1<<2)
#define	SEG_D		(0x1<<3)
#define	SEG_E		(0x1<<4)
#define	SEG_F		(0x1<<5)
#define	SEG_G		(0x1<<6)
#define	SEG_DP		(0x1<<7)


/*
	 ________
	|   a    |
	|        |
	|b       |f
	|________|
	|   g    |
	|c       |e
	|        |
	|________| o dp
            d
*/

#define	DISP_0		(SEG_A|SEG_B|SEG_C|SEG_D|SEG_E|SEG_F)
#define	DISP_1		(SEG_F|SEG_E)
#define	DISP_2		(SEG_A|SEG_F|SEG_G|SEG_C|SEG_D)
#define	DISP_3		(SEG_A|SEG_F|SEG_G|SEG_E|SEG_D)
#define	DISP_4		(SEG_B|SEG_G|SEG_F|SEG_E)
#define	DISP_5		(SEG_A|SEG_B|SEG_G|SEG_E|SEG_D)
#define	DISP_6		(SEG_A|SEG_B|SEG_C|SEG_D|SEG_E|SEG_G)
#define	DISP_7		(SEG_A|SEG_F|SEG_E)
#define	DISP_8		(SEG_A|SEG_B|SEG_C|SEG_D|SEG_E|SEG_F|SEG_G)
#define	DISP_9		(SEG_A|SEG_B|SEG_G|SEG_F|SEG_E|SEG_D)

#define	DISP_A		(SEG_A|SEG_B|SEG_C|SEG_E|SEG_F|SEG_G)
#define	DISP_B		(SEG_B|SEG_C|SEG_D|SEG_E|SEG_G)
#define	DISP_C		(SEG_A|SEG_B|SEG_C|SEG_D)
#define	DISP_D		(SEG_C|SEG_D|SEG_E|SEG_F|SEG_G)
#define	DISP_E		(SEG_A|SEG_B|SEG_C|SEG_D|SEG_G)
#define	DISP_F		(SEG_A|SEG_B|SEG_C|SEG_G)

#define	DISP_ALL_OFF	(0)
#define	DISP_ALL_ON	(SEG_A|SEG_B|SEG_C|SEG_D|SEG_E|SEG_F|SEG_G|SEG_DP)

#define DISP_ROW_3	(SEG_A|SEG_C|SEG_E)
#define DISP_COL_2	(SEG_B|SEG_D|SEG_G|SEG_F)


/* display a hex number on seg7 */
int seg7_init(void);
int seg7_display_num(int num);

int seg7_test(void);

 
 
